<%-- 
    Document   : dao3
    Created on : 2014/8/20, 下午 02:28:59
    Author     : gjun
--%>

<%@page import="java.sql.Statement"%>
<%@page import="java.sql.DriverManager"%>
<%@page import="java.sql.Connection"%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%
    String id = request.getParameter("id");
Class.forName("com.mysql.jdbc.Driver");
Connection  con = DriverManager.getConnection("jdbc:mysql://localhost:3306/javadb","root","root");
Statement st=con.createStatement();
String sql="delete from person where id=" + id;

System.out.println(sql);
int x=st.executeUpdate(sql);
st.close();
con.close();
%>

<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>JSP Page</title>
    </head>
    <body>
        <h1>Hello World!</h1>
        <%= x%>
         <a href="list.jsp">list</a>
    </body>
</html>

